<?php
    header('Content-Type: text/html; charset=utf8');
    session_start();
    include_once '../../../../controlador/php/conexion/Conexion10.php';
    $con = new Conexion10();
    
    $oid = $_REQUEST['oid'];
    
    $listado= "SELECT OID,PACNUMDOC,RTrim(GENPACIEN.PACPRINOM +' '+ GENPACIEN.PACSEGNOM) AS NOM_PACIENTE,
				RTrim(GENPACIEN.PACPRIAPE +' '+ GENPACIEN.PACSEGAPE) AS APE_PACIENTE, GPASEXPAC
			        FROM GENPACIEN
                                WHERE OID = '".$oid."'";

    $res = $con->query($listado);
      
    while
        ($res2 = mssql_fetch_array($res)){
        $lista[] = array_map(utf8_encode,$res2);
    }
    //echo json_encode($lista);
    
    $con->cerrarConexion();
    print_r(json_encode($lista))
    
 
?>
